home *** CD-ROM | disk | FTP | other *** search
- Path: news.ahc.ameritech.com!datalytics!usenet
- From: Rob Stewart <stew@datalytics.com>
- Newsgroups: comp.lang.c++
- Subject: Re: size_t
- Date: Wed, 20 Mar 1996 12:23:54 -0500
- Organization: Datalytics, Inc
- Message-ID: <31503F2A.C6F@datalytics.com>
- References: <4io7lj$482@hermes.acs.unt.edu> <4iomcj$c7m@moody.mchh.siemens.de>
- NNTP-Posting-Host: 204.62.224.71
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (WinNT; I)
-
- Ronald Fischer wrote:
- >
- > bgoodman@deathstar.cascss.unt.edu (Byron Goodman) wrote:
- > >
- > >Could some please explain what size_t data type is? From what I understand
- > >it is the sizeof() a pointer to a function.
- > >
- > sizeof(T) is the number of bytes that an object of type T occupies for
- > storage.
- > sizeof v is the number of bytes that the variable or array v occupies for
- > storage.
- >
- > This number is expresses as integral type size_t, which is often (but not
- > necessary) typedef'd to int.
- >
-
- I don't know of any implementation that typedefs size_t to int.
- It would be a non-conforming implementation if it did.
- According to ARM 5.3.2, size_t is "an implementation-dependent
- unsigned integral type defined in the standard header
- <stddef.h>."
-
- As you have indicated above, sizeof returns a constant of type
- size_t. However, you are free to use size_t anywhere you like.
- A common idiom is to use size_t for array indexes in
- array/vector classes.
-
- --
- Robert Stewart | My opinions are usually my own.
- Datalytics, Inc. | stew@datalytics.com
-